/**
 ***********************************************************************************************************************
 * Copyright (c) 2020, China Mobile Communications Group Co.,Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 
 * the License. You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *
 * @file        main.c
 *
 * @brief       User application entry
 *
 * @revision
 * Date         Author          Notes
 * 2020-02-20   OneOS Team      First Version
 ***********************************************************************************************************************
 */

#include <board.h>
#include "st7789vw.h"
#include "vfs_fs.h"
#include "cjson.h"
#include "weather.h"

int main(void)
{
    os_task_t *task1,*task2;
		int res;

    lcd_clear(WHITE);
		lcd_display_on();
		lcd_set_color(WHITE,BLUE);
		res=vfs_mount("sd0","/","fat",0,"");  
		if(res==0)
		{
			os_kprintf("SD init success\n");
			lcd_show_string(0,0,24," SD init success");
		}
		else
		{
			os_kprintf("SD init failed %d\n",res);
			lcd_show_string(0,0,24,"SD init failed");
		}
		os_task_msleep(2000);
		task1 = os_task_create("user", user_task, NULL,8196,3,200);
    OS_ASSERT(task1);
    os_task_startup(task1);
    task2 = os_task_create("weather",http_get_info_task, NULL,2048,4,200);
    OS_ASSERT(task2);
    os_task_startup(task2);
		return 0;
}
